﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>分组平铺</title>
     <script language="JavaScript" src="../../Comm/JScript.js" type="text/javascript" ></script>
    <script type="text/javascript" src="../../Scripts/bootstrap/js/jquery.min.js"></script>
    <script src="../../Scripts/QueryString.js" type="text/javascript"></script>
    <!-- 引用通用的js文件. -->
    <script type="text/javascript" src="../../Scripts/config.js"></script>
    <script type="text/javascript" src="../../Comm/Gener.js"></script>
    <link href="../../../DataUser/Style/ccbpm.css" rel="Stylesheet" />


    <script type="text/javascript">

        var selectedEles = null;
        var mapExt = null;

        $(function () {

            $("#Msg").html("正在加载,请稍后......");

            var mypk = GetQueryString("FK_MapExt");
            mapExt = new Entity("BP.Sys.MapExt", mypk);
            var srcOfGroup = mapExt.Tag1; //分组.
            var srcOfEntitis = mapExt.Tag2; //实体.

            var html = "关键字:";
            html += "<input type='text' id='TB_Key' name='TB_Key' />";
            html += "<input type='button' id='Btn_Search' name='Btn_Search' value='查询' />";

            $("#Msg").html(html);

            // var groups = DBAccess.RunSQLReturnTable(srcOfGroup); //分组.
            // var entities = DBAccess.RunSQLReturnTable(srcOfEntitis); //数据源.

        });
       
        //选择与取消选择.
        function CheckAll(checked, no) {

            $("input[name='" + no + "']").each(function () {
                this.checked = checked;
            });
         
        }

        //保存.
        function Save() {

           //获得存储的值.
            var selectVals = [];
        
            //获得选择的数据.
            var selectType = mapExt.GetPara("SelectType");
            if (selectType == "0") {  //单选.
                selectVals.push($("input[name='RB']:checked").val());
            } else {

                var cbs = $("input[type='checkbox']:checked");

                cbs.each(function () {
                    if (this.id.indexOf('CB_') == -1)
                        return true;
                    selectVals.push(this.value);
                });
            }

            alert(selectVals.join(','));

          


            //插入新选择的数据.

            //获得已经选择的集合.
              // var eleDBs = new Entities("BP.Sys.FrmEleDBs");
              // eleDBs.Retrieve("FK_MapData", mapExt.FK_MapExt, "EleID", mapExt.AttrOfOper, "RefPKVal", GetQueryString("PKVal"));

            //组成返回的字符串.

            //执行返回,并关闭窗口.
        }

    </script>
</head>
<body>
 
 <table id="Table1" >
  
 </table>

 <div id="Msg"> </div>

</body>
</html>
